package com.codecrane.core.util;

/**
 * 获取币种
 */
public enum PhysicalFreightTypeEnum {
    运费(0, "运费"),
    关税(1, "关税"),
    头程(2, "头程"),
    海运(3, "海运"),
    尾程(4, "尾程");

    private int code;
    private String msg;

    PhysicalFreightTypeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static String getFreightType(Integer code) {
        if(code==null){
            return "";
        }else {
            for (PhysicalFreightTypeEnum countryEnum : PhysicalFreightTypeEnum.values()) {
                if (code == countryEnum.getCode()) {
                    return countryEnum.getMsg();
                }
            }
        }
        return "";
    }
}
